JavaScript itself does not determine whether a variable is a null function, because the variable may be string,object,number,boolean and other types, different types, and the judging method is different. So in the article wrote a function, to
1) Intro
Not long ago I set up a technology group in a MM asked a question like this, she posted the code as follows:
var a = 1;function hehe (){Window.alert (a);var a = 2;Window.alert (a);}Hehe ();
The results of the execution are as follows:
JavaScript Learning record day6-function variable scope, deconstruction assignment and method@ (learning) [JavaScript][TOC]1. ScopeIn JavaScript, variables that are var declared are actually scoped.If a variable is declared inside the function body,
False, zero, null, undefined, and empty string objects in Javascript
In Javascript, We often come into contact with the five special objects mentioned in the question -- false, 0, empty string, NullAnd undefined. These objects are easy to use
When discussing the primitive data types in Javascript, most people know the basic knowledge, from String, Number to Boolean. These primitive types are quite simple and behavior is common sense. However, this article will focus more on the unique
ArticleDirectory
Javascript Introduction
How to Implement Javascript
Where to place Javascript
Javascript statements
Javascript Variables
Javascript Operators
Javascript branch statement
Javascript message box
if (judgment expression) {Execute content}If the expression is true, the contents of the parentheses are executed.Here, if the variable is not 0,null,undefined,false, it will be handled as true. As long as the variable has a value other than 0 or an
Most computer languages have and have only one value that denotes "none", such as the nil of the None,ruby language of the Null,python language of the C language Null,java language.
Oddly enough, the JavaScript language actually has two values that
This article mainly introduces the Null and Undefined primitive data types in javascript. If you need them, you can refer to the basic knowledge that most people know when discussing the primitive data types in JavaScript, from String, Number to
Front.
The General program language, which indicates null only NULL, but JavaScript designer Brendan Eich but designed a undefined, which undoubtedly increased the complexity of the program, but there are some reasons for this. This article
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.